import { expect } from 'chai';
import range from '../src/range';

describe('range unit test', function() {
    it('should return [] if no arguments is given', function() {
        expect(range()).to.eql([]);
    });

    it('should return [1, 2] for range(1, 3)', function() {
        expect(range(1, 3)).to.eql([1, 2]);
    });

    it('should return [1, 3, 5, 7, 9] for range(1, 10, 2)', function() {
        expect(range(1, 10, 2)).to.eql([1, 3, 5, 7, 9]);
    });

    it('should return [1, 2, 3] for range(1, 4, 0)', function() {
        expect(range(1, 4, 0)).to.eql([1, 2, 3]);
    });

    it('should return [4, 3, 2] for range(4, 1)', function() {
        expect(range(4, 1)).to.eql([4, 3, 2]);
    });

    it('should return [4, 2, 0] for range(4, -1, -2)', function() {
        expect(range(4, -1, -2)).to.eql([4, 2, 0]);
    });
})